<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">
<h:head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</h:head>
<h:body>
	<div style="width:100%;font-size:36px;line-height:48px;background-color:navy;color:white">H6 EDUCACIONAL</div>
	<div id="heading">
		<ui:insert name="heading">
			<ui:include src="templates/menu.xhtml" />
		</ui:insert>
	</div>
	<h:form>
		<h:outputText value="Ano Letivo: " />  
        <p:selectOneMenu value="#{manterTurmaManager.anoSelec}" effect="fold" editable="true">  
            <f:selectItem itemLabel="Select One" itemValue="" />  
            <f:selectItems value="#{manterTurmaManager.anos}" />  
        </p:selectOneMenu>  
        
		<p:dataTable id="tabela" var="turmas" rowKey="#{turmas.id}" value="#{manterTurmaManager.turmas}"
			selectionMode="single" selection="#{manterTurmaManager.turmaSelec}" 
			emptyMessage="Não encontrado nenhuma ocorrência" >
	        <p:column headerText="ID">
	            <h:outputText value="#{turmas.id}" />
	        </p:column>
	        <p:column headerText="Ano">
	        	<h:outputText value="#{turmas.ano}" />
	        </p:column>
	        <p:column headerText="Série">
	        	<h:outputText value="#{turmas.serie}" />
	        </p:column>
	        <p:column headerText="Dígito">
	        	<h:outputText value="#{turmas.digito}" />
	        </p:column>  
	        <p:column headerText="Sala">
	        	<h:outputText value="#{turmas.sala}" />
	        </p:column>  
		</p:dataTable>
		<p:commandButton value="Cadastrar" icon="ui-icon-plus" style="margin:0"
							action="#{manterTurmaManager.cadastrar()}" />
		<p:commandButton value="Editar" icon="ui-icon-pencil" style="margin:0"
							action="#{manterTurmaManager.editar()}" />
		<p:commandButton value="Remover" update="tabela" icon="ui-icon-close" style="margin:0"
							action="#{manterTurmaManager.remover()}" />
	</h:form>
</h:body>
</html>